# -*- coding: UTF-8 -*-

from math import *
import random
from etoile import Etoile


class Univers():
    def __init__(self, seed):
        self.limiteX=40
        self.limiteY=40
        self.limiteZ=40
        self.listeEtoiles=[]
        self.isVueUnivers = True
        random.seed(seed)
    
    def genererEtoiles(self):
        for i in range(10):
            x=random.randint(254,2966)
            y=random.randint(254,1566)
            z=random.randint(1,3900)
            occ=True
            
            while(occ):
                occ=False
                for i in self.listeEtoiles:  
                    if ((i.x < x+468 and i.x > x- 468) and (i.y < y+468 and i.y > y-468)):
                        x=random.randint(254,2966)
                        y=random.randint(254,1566)
                        z=random.randint(1,3900)
                        occ=True
                        break
            e=Etoile(len(self.listeEtoiles)+1,x,y,z)
            self.listeEtoiles.append(e)
                            